package myICGen;

import java.util.ArrayList;
import java.util.List;

public class Symbol {
    enum SymbolType
    {
        Variable,
        Func,
        FuncD,  //函数申明
        Array,
        EMPTY
    }

    public String symbolTypeToString()
    {
        if(symbolType == SymbolType.Variable)
            return "Variable";
        else if(symbolType == SymbolType.Array)
            return "Array Variable";
        else if(symbolType == SymbolType.Func || symbolType == SymbolType.FuncD)
            return  "Function";
        else
            return "";
    }

    Symbol()
    {
        params = new ArrayList<>();
        type = "";
        symbolType = SymbolType.EMPTY;
    }
    Symbol(Symbol symbol)
    {
        this.symbolType = symbol.symbolType;
        this.id = symbol.id;
        this.type = symbol.type;
        this.params = new ArrayList<>();
        this.params.addAll(symbol.params);
    }
    public SymbolType symbolType;
    public String id;
    public String type;
    public List<String> params;
}
